<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of _tablelist
 *
 * @author Chris Sim
 */
/* foreach($data->details as $detail )
    echo $detail->ref_no;*/
print_r($data->data[4]->details);
 $this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$data,
    'ajaxUpdate'=>true,
    'id'=>'internal_grid',
    'columns'=>array(
        array(
             'value' => '$data->getDO($data->details())',
             //expression to output HTML as html (otherwise simple text with tags is shown)
         ),
        array(  'class'=>'CLinkColumn',
                'header'=>'Customer',
                'labelExpression'=>'$data->customer->cname',
                'urlExpression'=>'Yii::app()->createUrl("profile/show",array("id"=>$data->primaryKey))',
            ),
        array(  'class'=>'CLinkColumn',
                'labelExpression'=>'$data->consignee->cname',
                'urlExpression'=>'Yii::app()->createUrl("profile/show",array("id"=>$data->primaryKey))',
            ),
       array(  'class'=>'CDataColumn',
                'dataField'=>'$data->consignee->cname',
                'dataExpression'=>'Yii::app()->createUrl("profile/show",array("id"=>$data->primaryKey))',
            ),
        
        array(            // display a column with "view", "update" and "delete" buttons
            'class'=>'CRudColumn',
            'template'=>'{view} {update}',
            'viewButtonUrl'=>'',
            'viewButtonOptions'=>array('onclick'=>'alert("lol")')

        ),
    ),
    
));
?>
<button onclick="test = $.fn.yiiGridView.getSelection('internal_grid');alert(test[1])">get info</button>
<div id="test"></div>